package dcc.tools;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class BeanFactory {

	private static ApplicationContext context;

	private BeanFactory() {

	}

	public static void build() {
		if (BeanFactory.context == null) {
			BeanFactory.context = new ClassPathXmlApplicationContext(
					"/dcc/resources/config/applicationContext.xml");
		}
	}

	public static Object getBean(String name) {
		return BeanFactory.context.getBean(name);
	}
}
